package cn.edu.neu;

/**
 * @Author: fenglong
 * @Date: 2024-02-29
 * @Description:
 */
public class App1 {
    public static void main(String[] args) {
        ManagePay managePay = new ManagePay();
        managePay.managePay(new ALiPay());
    }
}
class ManagePay{
    public void managePay(Payment payment){
        payment.pay();
    }
}
abstract class Payment{
    int type = 0;
    abstract public void pay();
}
class ALiPay extends Payment{//默认会赠送一个无参的构造函数,如果你加了带参数的
    public ALiPay() {
        super.type = 1;
    }
    public void pay(){
        System.out.println("ALiPay方法pay。。。。");
    }
}
